//
//  LcbUITableViewCell.m
//  huien
//
//  Created by yiban on 2017/5/26.
//  Copyright © 2017年 lcb. All rights reserved.
//

#import "LcbUITableViewCell.h"
@interface LcbUITableViewCell()
{
    
}

@end
@implementation LcbUITableViewCell

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self)
    {
        self.backgroundColor=[UIColor whiteColor];
        self.selectionStyle = UITableViewCellSelectionStyleNone;
    }
    return self;
}

- (void)layoutSubviews
{
    [super layoutSubviews];
    self.line.frame = CGRectMake(0, self.frame.size.height-1, SCREEN_WIDTH, 1);
}
-(void)dealloc
{
    self.actionBlock=nil;
    self.data=nil;
    self.indexPath=nil;
    self.key=nil;
}

-(void)setCallBack:(void(^)(BEventType,UIView*,NSInteger,id,NSIndexPath *))callback
{
    self.actionBlock =callback;
}
/// 根据数据模型来显示内容
- (void)showInfo:(id)model indexPath:(NSIndexPath *)indexPath
{
    self.data =model;
    self.indexPath=indexPath;
}
/// 根据key模型来显示内容
- (void)showInfo:(id)model key:(id)key indexPath:(NSIndexPath *)indexPath
{
    self.data =model;
    self.key =key;
    self.indexPath=indexPath;
}
/// 返回Cell高度
+ (CGFloat)returnCellHeight:(id)model
{
    return 0;
}

//返回固定高度
+ (CGFloat)returnCellHeight {
    return 0;
}

//绘制cell分割线
- (void)drawRect:(CGRect)rect {
//    CGContextRef context = UIGraphicsGetCurrentContext();
//    CGContextSetFillColorWithColor(context, [UIColor clearColor].CGColor);
//    CGContextFillRect(context, rect);
//    //上分割线，
//    CGContextSetStrokeColorWithColor(context, UIColorFromRGB(0xe3e3e3).CGColor);
//    CGContextStrokeRect(context, CGRectMake(0, -0.5, rect.size.width, 0.5));
//    //下分割线
//    CGContextSetStrokeColorWithColor(context, UIColorFromRGB(0xe3e3e3).CGColor);
//    CGContextStrokeRect(context, CGRectMake(0, rect.size.height, rect.size.width, 0.5));
}
-(UIView*)line
{
    if (!_line) {
        _line =[[UIView alloc] initWithFrame:CGRectMake(0, 0, self.frame.size.width, 1)];
        _line.backgroundColor=linecolor;
        [self addSubview:_line];
    }
    return _line;
}
@end
